package com.ijiuchuang.jc_localization.network.api;

import com.ijiuchuang.jc_localization.bean.bmob.AppVersion;
import com.ijiuchuang.jc_localization.bean.bmob.Banner;
import com.ijiuchuang.jc_localization.bean.bmob.Product;
import com.ijiuchuang.jc_localization.bean.bmob.Result;
import com.ijiuchuang.jc_localization.bean.bmob.Solution;

import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;
import rx.Observable;

/**
 * Created by Veev on 2016/6/8
 *
 * @link 384506557@qq.com
 */
public interface BmobApi {

    @GET("1/classes/Product")
    Observable<Result<Product>> getProducts();

    @GET("1/classes/Solution")
    Observable<Result<Solution>> getSolutions();

    /**
     * ?where={"isShow":true} 需要进行url编码
     * 左花括号     { %7B
     * 右花括号     } %7D
     * 双引号      "  %22
     * 空格         %20
     * @return
     */
    @GET("1/classes/Banner?where=%7B%22isShow%22:true%7D&order=number")
    Observable<Result<Banner>> getBanners();

    @GET("1/classes/Product/{id}")
    Observable<Product> getProduct(@Path("id") String id);

    @GET("1/classes/AppVersion/{id}")
    Observable<AppVersion> getVersionName(@Path("id") String id);
}
